<template>
  <div id="portal-form-list-container" class="app-menu">
    <div id="ApplicationList" class="application-box" ref="application">
      <!-- style="height: 0px" -->
      <!-- <printHtml style="height: 0px"  :options="opts" /> -->
      <!-- v-if="showTitle" -->
      <div class="content-top" ref="contentTop">
        <h2>
          <a-breadcrumb>
            <a-breadcrumb-item
              v-for="(item, index) in appNameList"
              :key="index">
              {{ typeof item === 'object' ? isChinese ? item.name : item.name_i18n : item }}
            </a-breadcrumb-item>
            <a-breadcrumb-item v-if="queryHeaderList.length > 1">
              <div class="table-toolbar-title">
                <div
                  class="list-header"
                  @click="showQueryHeaderList = !showQueryHeaderList"
                >
                  <div :title="isChinese ? curTitle : curTitleNameI18n[$i18n.locale]">
                    {{ isChinese ? curTitle : curTitleNameI18n[$i18n.locale] }}
                  </div>
                  <i
                    v-show="!showQueryHeaderList && showIcon"
                    class="icon aufontAll h-icon-all-down-o"
                  ></i>
                  <i
                    v-show="showQueryHeaderList && showIcon"
                    class="icon aufontAll h-icon-all-up-o"
                  ></i>
                </div>
                <div class="query-header-list" v-if="showQueryHeaderList && showIcon">
                  <div
                    class="list-item"
                    :class="{ selected: curListCode === list.code }"
                    v-for="(list, index) in queryHeaderList"
                    :key="index"
                    @click="changeListView(list)"
                  >
                    <div class="item-name">
                      {{ isChinese ? list.name : list.name_i18n[$i18n.locale] }}
                    </div>
                  </div>

                  <div class="filter-mask" @click="showQueryHeaderList = false"></div>
                </div>
              </div>
            </a-breadcrumb-item>
          </a-breadcrumb>

          <!-- 左侧logo -->
          <!-- <slot name="left"></slot> -->
          <!-- 1 -->
          <!-- <span v-if="isSPA">{{ $route.params.displayName }}</span> -->
          <!-- <div
            class="list-header"
            @click="showQueryHeaderList = !showQueryHeaderList"
          >
            <div :title="isChinese ? curTitle : curTitleNameI18n[$i18n.locale]">
              {{ isChinese ? curTitle : curTitleNameI18n[$i18n.locale] }}
            </div>
            <i
              v-show="!showQueryHeaderList && showIcon"
              class="icon aufontAll h-icon-all-down-o"
            ></i>
            <i
              v-show="showQueryHeaderList && showIcon"
              class="icon aufontAll h-icon-all-up-o"
            ></i>
          </div> -->

          <!-- <div class="query-header-list" v-if="showQueryHeaderList && showIcon">
            <div
              class="list-item"
              :class="{ selected: curListCode === list.code }"
              v-for="(list, index) in queryHeaderList"
              :key="index"
              @click="changeListView(list)"
            >
              <i class="icon aufontAll h-icon-all-layout-o"></i>
              <div class="item-name">
                {{ isChinese ? list.name : list.name_i18n[$i18n.locale] }}
              </div>
              <i
                class="checked icon aufontAll h-icon-all-check"
                v-show="curListCode === list.code"
              ></i>
            </div>

            <div class="filter-mask" @click="showQueryHeaderList = false"></div>
          </div> -->
        </h2>

        <!-- 操作 -->
        <div class="actions-box">
          <!-- 设置展示项 -->
          <div class="settings">
            <!-- 筛选操作 -->
            <!-- <div
              class="settings-item"
              v-if="queryConditions && visibleQueryConditions.length > 0"
            >
              <filterCard
                @clear="clear"
                v-if="queryConditionSource.length === 1"
                :source="queryConditionSource"
              />
              <filterCard
                @item-click="toggleQueryConditions"
                @clear="clear"
                v-else-if="queryConditionSource.length > 1"
                :source="queryConditionSource"
              />
              <a-tooltip v-if="queryConditionSource.length <= 1">
                <template slot="title">
                  {{ $t("cloudpivot.list.pc.Screen") }}
                </template>
                <i
                  class="icon aufontAll h-icon-all-filter-o"
                  :class="{ 'high-light': isShowFilterBox }"
                  @click="toggleQueryConditions"
                ></i>
              </a-tooltip>
            </div> -->

            <!-- 字段设置操作 -->
            <!-- <div class="settings-item">
              <a-tooltip>
                <template slot="title">
                  {{ $t("cloudpivot.list.pc.SetDisplayItems") }}
                </template>
                <i
                  class="icon aufontAll h-icon-all-setting-o"
                  @click="columnSetting"
                ></i>
              </a-tooltip>
            </div> -->

            <!-- 表单留痕操作 -->
            <!-- <div class="settings-item" v-if="formTrackPermission">
              <a-tooltip>
                <template slot="title">
                  {{ $t("cloudpivot.list.pc.FormTrack") }}
                </template>
                <a-icon class="form-track" type="history"
                  @click="showFormTrack"
                />
              </a-tooltip>
            </div> -->
          </div>

          <!-- 其他操作按钮:新增/删除/... -->

          <div id="list-actions" ref="actions">
            <div v-if="modelType !== 'TREE'" class="list-actions-more">
              <a-popover
                overlayClassName="list-actions-popover"
                placement="bottom"
              >
                <template slot="content" v-if="!checkeds.some(item=>item)">
                  <p
                    v-for="(el, index2) in moreActions"
                    :key="index2"
                    @click="(e) => actionClick(el, e)"
                  >
                    {{ isChinese ? el && el.name : el && (zhToen[el.name] || el.name) }}
                  </p>
                </template>
                <template slot="content" v-else>
                  <p
                    v-for="(el, index2) in checkedMoreActions"
                    :key="index2"
                    @click="(e) => actionClick(el, e)"
                  >
                    {{ isChinese ? el && el.name : el && (zhToen[el.name] || el.name) }}
                  </p>
                </template>
                <!-- <i v-show="!checkeds.some(item=>item)" class="icon aufontAll h-icon-all-ellipsis-o"></i> -->
                <i v-if="moreActions.length || (checkedMoreActions.length && checkeds.some(item=>item))" class="icon aufontAll h-icon-all-ellipsis-o"></i>
              </a-popover>
            </div>
            <template v-for="(ac, index) in queryActions">
              <template v-if="ac ? (ac.actionCode !== 'batch_print') : false">

                <template  v-if="ac.associationType === 1 && ac.actionCode === 'import'">
                  <a-tooltip :key="index">
                    <template slot="title">
                      <span>{{ $t("cloudpivot.list.pc.importWorkflowTips") }}</span>
                    </template>
                    <a-button v-show="ac.actionCode !== 'edit' && ac.actionCode !== 'form_track' && ac.actionCode !== 'FORM_TRACK' && !deleteDisabled" :disabled="true">
                      {{
                      isChinese ? ac && ac.name : ac && (zhToen[ac.name] || ac.name)
                      }}
                    </a-button>
                  </a-tooltip>
                </template>
                <template v-else>
                  <a-button
                    v-if="
                      ac.actionCode !== 'edit' &&
                      ac.actionCode !== 'form_track' &&
                      ac.actionCode !== 'FORM_TRACK' &&
                      ((!deleteDisabled && ac.actionCode === 'import') ||
                        ac.actionCode === 'export' ||
                        ac.actionCode === 'add')
                    "
                    :class="
                    ac ? (ac.attributes && ac.attributes.class) ||
                    `list-action-${ac.actionCode}` : ''
                  "
                    :id="ac && ac.attributes && ac.attributes.id"
                    :type="index === (queryActions.length-1) ? 'primary' : 'default'"
                    :key="index"
                    :disabled="
                    (!deleteDisabled && ac && ac.actionCode === 'delete') ||
                    (exportDisabled && ac && ac.actionCode === 'export') ||
                    (exportDisabled && ac && ac.actionCode === 'qr_code') ||
                    (!deleteDisabled && ac && ac.actionCode === 'editowner') ||
                    (ac && ac.actionCode === 'batch_update' && (isCheckedWorkFlow || !deleteDisabled) ) ||
                    (ac && ac.associationType === 1 && ac.actionCode === 'import')
                  "
                    @click="(e) => actionClick(ac, e)"
                  >
                    {{
                    isChinese ? ac && ac.name : ac && (zhToen[ac.name] || ac.name)
                    }}
                  </a-button>

                  <a-button
                    v-if="
                      ac.actionCode !== 'edit' &&
                      ac.actionCode !== 'form_track' &&
                      ac.actionCode !== 'FORM_TRACK' &&
                      deleteDisabled &&
                      (ac.actionCode === 'batch_update' ||
                        ac.actionCode === 'delete')
                    "
                    :class="
                      ac ? (ac.attributes && ac.attributes.class) ||
                      `list-action-${ac.actionCode}` : ''
                    "
                    :id="ac && ac.attributes && ac.attributes.id"
                    :type="'default'"
                    :key="index"
                    :disabled="
                      (!deleteDisabled && ac && ac.actionCode === 'delete') ||
                      (exportDisabled && ac && ac.actionCode === 'export') ||
                      (exportDisabled && ac && ac.actionCode === 'qr_code') ||
                      (!deleteDisabled && ac && ac.actionCode === 'editowner') ||
                      (ac && ac.actionCode === 'batch_update' &&
                        (isCheckedWorkFlow || !deleteDisabled)) ||
                      (ac && ac.associationType === 1 && ac.actionCode === 'import')
                    "
                    @click="(e) => actionClick(ac, e)"
                  >
                    {{ isChinese ? ac && ac.name : ac && (zhToen[ac.name] || ac.name) }}
                  </a-button>
                </template>
              </template>
              
              <!-- <span v-else :key="index" ref="printBatchShow"> -->
                <!-- <a-button
                  v-show="deleteDisabled"
                  :class="
                    ac ? (ac.attributes && ac.attributes.class) ||
                    `list-action-${ac.actionCode}` : ''
                  "
                  :id="ac && ac.attributes && ac.attributes.id"
                  :type="'default'"
                  :disabled="(exportDisabled && (ac && ac.actionCode === 'batch_print'))"
                  :key="index"
                  @click="(e) => actionClick(ac, e)"
                  >{{
                    isChinese ? ac && ac.name : ac && ac.name_i18n[$i18n.locale]
                  }}</a-button
                > -->
                <!-- <div
                  class="prints-drop-down animated fadeIn"
                  v-show="toShowPrints"
                  :style="printBtnListStyle"
                >
                  <template v-for="(i, v) in printTempList">
                    <a-tooltip placement="left" :key="v">
                      <template slot="title">
                        <span>{{ i.printTemplateName }}</span>
                      </template>
                      <div
                        class="item-print"
                        @click="handleBatchPrintHide(i.printTemplateCode)"
                      >
                        {{ i.printTemplateName }}
                      </div>
                    </a-tooltip>
                  </template>
                </div> -->
              <!-- </span> -->
            </template>
          </div>
        </div>
      </div>

      <!-- table操作栏 -->
      <div class="table-toolbar">
        <div class="table-toolbar-box">
          <!-- <div class="table-toolbar-title">
            <div
              class="list-header"
              @click="showQueryHeaderList = !showQueryHeaderList"
            >
              <div :title="isChinese ? curTitle : curTitleNameI18n[$i18n.locale]">
                {{ isChinese ? curTitle : curTitleNameI18n[$i18n.locale] }}
              </div>
              <i
                v-show="!showQueryHeaderList && showIcon"
                class="icon aufontAll h-icon-all-down-o"
              ></i>
              <i
                v-show="showQueryHeaderList && showIcon"
                class="icon aufontAll h-icon-all-up-o"
              ></i>
            </div>
            <div class="query-header-list" v-if="showQueryHeaderList && showIcon">
              <div
                class="list-item"
                :class="{ selected: curListCode === list.code }"
                v-for="(list, index) in queryHeaderList"
                :key="index"
                @click="changeListView(list)"
              >
                <div class="item-name">
                  {{ isChinese ? list.name : list.name_i18n[$i18n.locale] }}
                </div>
              </div>

              <div class="filter-mask" @click="showQueryHeaderList = false"></div>
            </div>
          </div> -->
          <div class="table-toolbar-box-li" v-if="formTrackPermission" @click="showFormTrack">
            <i class="icon aufontAll h-icon-all-reload-time"></i>
            <span>
              {{ $t("cloudpivot.list.pc.FormTrack") }}
            </span>
          </div>
          
          <div class="table-toolbar-box-li">
            <a-popover 
              trigger="click" 
              placement="bottomRight" 
              overlayClassName="font-setting-drag"
              :destroyTooltipOnHide="true"
            >
              <template slot="content">
                <FontSetting   
                :columns="columns"
                @confirm="reRenderTable"
                @recovery="recovery"
                @search="filterColumns"/>
              </template>
               <i class="icon aufontAll h-icon-all-setting-fill"></i>
               <span>
                 {{ $t("cloudpivot.list.pc.SetDisplayItems") }}
               </span>
            </a-popover>
          </div>
          <div class="table-toolbar-box-li" v-if="queryConditions"
            @click="toggleQueryConditions"
            :class="{ 'high-light': isShowFilterBox || queryActive }" 
          >
            <!-- <a-popover trigger="click" 
            placement="bottomRight" 
            overlayClassName="toggle-query-conditions"
            v-model="isShow"
            >
              <template slot="content">
                 <PageSelectMotail
                   ref="child"
                   class="page-select-motail"
                   :selectType="11"
                   @search="searchWorkitems"
                 />
              </template>
               <i
              class="icon aufontAll h-icon-all-filter-o"
              :class="{ 'high-light': isShowFilterBox }"
             ></i>
             {{ $t("cloudpivot.list.pc.Screen") }}
            </a-popover> -->
              <i
                class="icon aufontAll h-icon-all-screen"
              ></i>
              <span>
                {{ $t("cloudpivot.list.pc.Screen") }}
              </span>
          </div>
        </div>
      </div>

      <!-- {{dataSource}} -->

      <!-- 加载状态 -->
      <PageLoading v-model="isLoading" shadeColor="#F4F6FC" :shadeOpacity="1" />
      <!-- 列表数据 -->
      <div class="table-box" v-if="isShowTableBox">
        <div class="filters-box" v-show="isShowFilterBox" ref="filtersBox">
          <query-form
            ref="queryForm"
            :fields="queryConditions"
            :relevanceDataList="relevanceDataList"
            :dataItemList="dataItemList"
            @getRelevanceDataList="getRelevanceDataList"
            @setFilterData="setFilterData"
            @hide="hideQueryItem"
          />
        </div>
        <div class="table" ref="table">
        <div>
          <tree-query-form @setFilterData="setFilterData"/>
        </div>
        <!-- 加载状态 -->
        <PageLoading v-model="tableLoading" shadeColor="#F4F6FC" :shadeOpacity="0.5" :delay="500" />
        <!-- 旧版表单 -->
        <sheet
          v-if="tableConfig.keepInOldVersion || tableConfig.version === '1.0'"
          v-show="cusColumns.length > 0"
          :checkbox="canDelete"
          :checkeds="checkeds"
          :columns="cusColumns"
          :rows="rows"
          :columnSlots="columnSlots"
          :rowSlots="rowSlots"
          @check="onCheck"
          @columnResize="onResizeEnd"
        >
          <!-- checkbox -->
          <span slot="checkboxTitle" v-if="canDelete">
            <a-checkbox
              @change.stop="selectAll"
              v-model="isSelectAll"
            ></a-checkbox>
          </span>
          <!-- 序号 -->
          <span class="order-number-box" slot="indexTitle">
            <span>{{ $t("cloudpivot.list.pc.Number") }}</span>
          </span>

          <span slot="checkbox" v-if="canDelete" slot-scope="{ text, row }">
            <a-checkbox
              v-model="row.isChecked"
              @change.stop="onItemCheckboxChange"
            ></a-checkbox>
          </span>
          <span class="order-number-box" slot="index" slot-scope="{ row }">
            <span>{{ JSON.stringify(row) }}</span>
          </span>

          <!-- 自定义的列 头 -->
          <template v-for="(item, index) in cusColumns">
            <span
              :key="index"
              :slot="columnSlots[item.key]"
              :title="item.vcTitle"
              class="text-ellipsis"
              v-show="item.isShow"
              >{{
                isChinese ? item.vcTitle : item.name_i18n[$i18n.locale]
              }}</span
            >
          </template>

          <!-- 自定义的列 表体 :title="text" -->
          <template
            v-for="(item, index) in cusColumns"
            :slot="rowSlots[item.key]"
            slot-scope="{ column, rowIndex }"
          >
            <span
              :key="index"
              class="cursor text-ellipsis"
              v-show="item.isShow"
              @click="goForm(column, rowIndex)"
              >{{ getLabelContent(column, rowIndex) }}</span
            >
          </template>
        </sheet>
        <!-- 新版表单 -->
        <list-custom-template
          v-else
          class="custom-template-container"
          ref="listCustomTemplate"
          v-show="cusColumns.length > 0"
          :pageVM="pageVM"
          :sortConfig="listConfig ? (listConfig.querySorts ? listConfig.querySorts : []) : []"
          :tableConfig="tableConfig"
          :originalTableColumns="cusColumns"
          :originalTableData="dataSource"
          :originalNumberData="numberData"
          :subQueryformConditions="subQueryformConditions"
          @bySortGetQueryList="bySortGetQueryList"
          @onCheck="onCheck"
          @onResizeEnd="onResizeEnd"
          @getAsyncTreeData="getAsyncTreeData"
          :modelType="modelType"
          :isOpen="isOpen"
        >
        </list-custom-template>

        <!-- 所有列取消勾选  -->
        <div
          class="no-columns"
          v-if="
            cusColumns.length <= 0 && !isShowNoData && !isShowSearchNoData
          "
        >
          <img src="./components/no-data/images/no-data.png" alt="" />
          <p>{{ $t("cloudpivot.list.pc.chooseColumns") }}</p>
        </div>

        <div class="no-data" v-if="isShowNoData || isShowSearchNoData">
          <PageNoData
            :isShowNoData="isShowNoData"
            :isShowSearchNoData="isShowSearchNoData"
            :tipText="$t('cloudpivot.list.pc.NoData')"
          />
        </div>
        </div>
        <div
          class="pagination-box"
          ref="paginationBox"
          v-if="cusColumns.length > 0"
        >
          <a-pagination
            v-if="modelType !== 'TREE' && total"
            :current="curPage"
            :total="total"
            :showTotal="
              (total) => $t('cloudpivot.list.pc.Total', { num: total })
            "
            :pageSize="pageSize"
            :pageSizeOptions="pageSizeOptions"
            showSizeChanger
            showQuickJumper
            @change="onPaginationChange"
            @showSizeChange="onSizeChange"
          />
          <span v-else class="tree-total">
            {{ isChinese ? `共${total}条` : `Total ${total}` }}
          </span>
        </div>

        <!-- 导出图标 -->
        <div class="import-icon" v-if="importIcon" @click="hideImportIcon" title="导出列表">
            <img src="./image/import.png" alt="导出列表">
        </div>
      </div>

      <div class="load-fail-box">
        <PageLoadFail v-model="isShowLoadFailBox" @refresh="reload" />
      </div>

    </div>

    <model-table-import
      v-if="visible"
      :schemaCode="schemaCode"
      :queryCode="curListCode"
      :statusParams="{errorMsg,successNum,failNum,importSize,importStatus,importFileName,showImportErrModal}"
      :showImportStatus="showImportStatus"
      @change="changeImportBtnStatus"
      @setFileName="setImportFileName"
      @setQueryField="setImportQueryField"
      @reset="reset"
      @ok="handleCancel"
      @importEnd="importEnd"
      @close="handleCancel"
      @setData="confirm"></model-table-import>

            <!--    <a-modal-->
<!--      class="import-modal"-->
<!--      v-model="visible"-->
<!--      :title="$t('cloudpivot.list.pc.ImportData')"-->
<!--      @cancel="handleCancel"-->
<!--      :width="552"-->
<!--      :destroyOnClose="true"-->
<!--      :footer="null"-->
<!--      :mask="true"-->
<!--      :maskClosable="false"-->
<!--      :keyboard="false"-->
<!--    >-->
<!--      <data-upload-->
<!--        v-if="showUploadModel"-->
<!--        @change="changeImportBtnStatus"-->
<!--        @setFileName="setImportFileName"-->
<!--        @setQueryField="setImportQueryField"-->
<!--        :schemaCode="schemaCode"-->
<!--        :queryCode="curListCode"-->
<!--      ></data-upload>-->

<!--      <data-import-->
<!--        v-if="showImportModel"-->
<!--        :percent="importPercent"-->
<!--        @importEnd="importEnd"-->
<!--      ></data-import>-->
<!--      <data-import-status-->
<!--        v-if="showImportStatus"-->
<!--        :successNum="successNum"-->
<!--        :failNum="failNum"-->
<!--        :importSize="importSize"-->
<!--        :status="importStatus"-->
<!--        :fileName="importFileName"-->
<!--        :schemaCode="schemaCode"-->
<!--        :queryCode="curListCode"-->
<!--      ></data-import-status>-->
<!--      <div class="modal-footer">-->
<!--        <a-button v-if="showCancelButton" key="back" @click="handleCancel">{{-->
<!--          $t("cloudpivot.list.pc.Cancel")-->
<!--        }}</a-button>-->
<!--        <a-button-->
<!--          v-if="showUploadModel"-->
<!--          key="import"-->
<!--          type="primary"-->
<!--          :disabled="!canImport"-->
<!--          @click="confirmImport"-->
<!--          >{{ $t("cloudpivot.list.pc.StartImport") }}</a-button-->
<!--        >-->
<!--        <a-button-->
<!--          v-if="showConfirmButton"-->
<!--          key="confirm"-->
<!--          type="primary"-->
<!--          @click="confirm"-->
<!--          >{{ $t("cloudpivot.list.pc.OK") }}</a-button-->
<!--        >-->
<!--        &lt;!&ndash; <a-button-->
<!--          v-if="showReImportButton"-->
<!--          key="reimport"-->
<!--          type="primary"-->
<!--          @click="reImport"-->
<!--        >{{ $t('cloudpivot.list.pc.ReImport') }}</a-button> &ndash;&gt;-->
<!--      </div>-->
<!--    </a-modal>-->
    <!-- 导入选人值报错时，导入错误信息弹窗 -->
    <!-- <button @click="showImportErrModal = true" style="position: absolute;top: 90px;left: 420px;z-index: 9898;">打开</button> -->
    <!-- 历史留痕弹窗 -->
    <form-marking ref="FormMarking" :dataItemList="dataSource"></form-marking>

    <ImportErrModal
      v-model="showImportErrModal"
      :status="secondImportStatus"
      :successNum="secondSuccessNum"
      :failNum="secondFailNum"
      :fileName="importFileName"
      :importData="importData"
      @reloadList="getQueryList"
    ></ImportErrModal>
    
    <!-- 表单导出 -->
    <DataExport
      v-model="showDataExport"
      :queryColumns="queryColumns"
      :extend1="extend1"
      :exportFileId="exportFileId"
      :type="listType"
      @exportEnd="handleExportData"
    ></DataExport>
    
    <!-- 打印二维码弹窗 -->
    <PrintQrcode
      v-model="showPrintQrcode"
      :checkedLength="checkedLength"
      @createPrintQrCodeData="createPrintQrCodeData"
    ></PrintQrcode>

    <PrintTemplateList
      v-model="toShowPrints"
      :printTempList="printTempList"
      @chosenTemplate="handleBatchPrintHide"
    ></PrintTemplateList>

    <!-- 修改表单拥有者弹框 -->
    <ModifyOwner
      :checkeds="checkeds"
      :dataSource="dataSource"
      :pageSize="pageSize"
      :curPage="curPage"
      :schemaCode="schemaCode"
      :queryCode="curListCode"
      ref="ModifyOwner"
      @modifyOwnerClick="onModifyOwnerClick"
    ></ModifyOwner>
    <!-- 删除弹窗 -->

    <columnSetting
      v-model="showColumnSetting"
      :columns="columns"
      @confirm="reRenderTable"
      @recovery="recovery"
    />
    <div
      class="pdf-frame-div"
      v-if="pdfUrl.includes('?file=') && isShowPdf"
    ></div>
    <iframe class="pdf-frame" id="pdfFrame" :srcdoc="srcdoc"></iframe>
    <a-icon
      v-if="isShowPdf"
      @click="closePdf"
      type="close"
      class="close-previewPdf"
    />
    <!-- :options="opts" -->
    <printHtml style="height: 0px; overflow: hidden" :options="opts" />
    <template v-if="isPrintGenerateHtml">
      <GenerateHtml
        ref="printRenderer"
        :pages="draftAttributesJsonSet"
        :formdata="formdata"
      ></GenerateHtml>
    </template>
    <template v-for="(i, n) of tempPrintEleArray">
      <template v-for="(tempPrintEle, v) in i">
        <TempPrintHtml
          :key="v + n + tempPrintEle.key"
          :printEle="tempPrintEle.tempPrintEle"
          :pageSettings="tempPrintPageSettings"
          @calcResult="collectorTempPrintInfo"
        ></TempPrintHtml>
      </template>
    </template>

    <batch-update @updateOver="updateOver" @visibleChange="updateVisibleChange" :oldParams="oldParams"  :updateOptions ="updateOptions" />

    <div class="iframe-shadow" v-if="showIframeForm"></div>
    <transition name="fade-down">
    <div v-if="showIframeForm" class="iframe-form-warp">
      <div class="icon-close" @click="showIframeForm = false">
        <!-- <span><a-icon type="close" /></span> -->
        <span class="icon aufontAll">&#xe996;</span>
      </div>
      <iframe ref="iframe" class="iframe-form-warp--page" :src="IframeFormUrl"></iframe>
    </div>
    </transition>
    <a-modal
      :visible="showDeleteDetail"
      :title="'删除-详情'"
      @cancel="() => {
        showDeleteDetail = false;
      }"
      :z-index="1001"
      width="800px"
      wrapClassName="delete-detail"
      >
      <div class="warn-info">
        <span class="title">
          <span class="icon aufontAll icon aufontAll h-icon-all-info-circle-fill"></span>
          注意事项
        </span><br/>
        <span class="tips"><strong>非父子流程的流程数据</strong>删除会同步删除已产生的流程实例</span><br/>
        <span class="tips"><strong>父流程的流程数据</strong>删除会同步删除绑定的子流程数据和实例</span><br/>
        <span class="tips"><strong>子流程的流程数据</strong>删除会同步删除实例以及父流程的映射关系</span><br/>
      </div>
      <a-table 
        :columns="deleteColumns" 
        :data-source="pageDeleteData" 
        bordered tableLayout="fixed"
        :pagination="false">
        <span slot="relativeModelTitle" class="resize">
          关联模型
          <a-tooltip>
            <template slot="title">
              <div>关联当前数据的模型; 若关联的模型过多，只查询最先建立</div>
              <div>关联关系的10个模型</div>
            </template>
            <span class="icon aufontAll icon h-icon-all-question-circle"></span>
          </a-tooltip>
        </span>
        <div
          slot="name"
          :title="record.name"
          slot-scope="text,record"
          class="dataCol"
        >
          {{record.name}}
        </div>
        <div
          slot="relativeModel"
          :title="record.relativeModel"
          slot-scope="text,record"
          class="dataCol"
        >
          {{record.relativeModel}}
        </div>
      </a-table>
      <div v-if="deleteData.length > 0" class="pagination">
        <a-pagination
          @change="pageChange"
          :pageSizeOptions="pageSizeOptions"
          :total="deleteData.length"
          :showTotal="total => `共${deleteData.length}条`"
          showSizeChanger
          showQuickJumper
          :defaultPageSize="pageSizeParams.size"
          :current="pageSizeParams.page"
          @showSizeChange="showSizeChange"
        />
      </div>
      <template slot="footer">
        <a-button @click="() => {
          showDeleteDetail = false;
        }">关闭</a-button>
      </template>
    </a-modal>
  </div>
</template>
<script src="./scripts/application-list.ts" />

<style lang="less" scoped>
/deep/ .delete-detail {
  .warn-info {
    width: 753px;
    height: 111px;
    background: #FFFBE6;
    border-radius: 4px;
    border: 1px solid #FFE58F;
    padding-left: 16px;
    padding-top: 9px;
    margin-bottom: 17px;
    .title {
      font-size: 14px;
      font-weight: 400;
      color: #111218;
      line-height: 22px;
      .h-icon-all-info-circle-fill {
        width: 14px;
        height: 14px;
        color: #FAAD14;
        margin-right: 4px;
        font-size: 14px;
      }
    }
    .tips {
      font-size: 12px;
      font-weight: 500;
      color: rgba(0, 0, 0, 0.85);
      line-height: 22px;
      padding-left: 21px;
    }
  }
  .ant-table-wrapper {
    max-height: 300px;
    overflow: auto;
  }
  .pagination {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    padding-top: 17px;
  }
  .h-icon-all-question-circle {
    width: 14px;
    height: 14px;
    color: #C3C4C5;
    font-weight: 100;
    font-size: 14px;
    padding-left: 8px;
  }
  .dataCol {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.application-box {
  /deep/.content-top {
    & > h2 {
      position: relative;
      padding-left: 8px;
    }
    .ant-breadcrumb-separator {
      margin: 0 2px;
    }
    .table-toolbar-title{
      // height: 30px;
      // line-height: 30px;
      position: relative;
      display: inline-block;
      .list-header {
        cursor: pointer;
        display: flex;
        // margin-left: 3px;
        // height: 30px;
        // font-size: 12px;
        // font-weight: 400;
        color: #141733;
        // line-height: 30px;
        align-items: center;
        // padding: 6px 0;
        & > div {
          display: inline-block;
          max-width: 155px;
          overflow: hidden;
          white-space: nowrap;
          vertical-align: middle;
          text-overflow: ellipsis;
        }
        i {
          font-size: 12px;
          color: rgba(0, 0, 0, 0.65);
          margin-left: 8px;
          height: 17px;
          line-height: 18px;
        }
      }
      .query-header-list {
        position: absolute;
        top: 35px;
        left: -12px;
        max-height: 520px;
        overflow-y: auto;
        background: #fff;
        box-shadow: 0px 2px 8px 0px rgba(30, 85, 255, 0.15);
        border-radius: 4px;
        z-index: 30;
        background: #FFFFFF;
        box-shadow: 0px 4px 11px 0px rgba(177, 177, 177, 0.5);
        border-radius: 2px;
        .list-item {
          height: 34px;
          line-height: 34px;
          // padding: 0 16px;
          cursor: pointer;
          position: relative;
          z-index: 9;
          &:hover {
            background: #f0f7ff;
          }
          &.selected {
            background: #EBF4FF;
          }
          i {
            color: #1890ff;
            font-size: 18px;
            float: left;
          }
          .item-name {
            // width: 292px;
            max-width: 432px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            margin-left: 12px;
            margin-right: 26px;
            float: left;
            height: 34px;
            font-size: 12px;
            font-weight: 400;
            color: #141733;
            line-height: 34px;
          }
          .checked {
            float: right;
          }
        }
      }
    }
  }
  // .list-header {
  //   cursor: pointer;
  //   & > div {
  //     display: inline-block;
  //     max-width: 144px;
  //     overflow: hidden;
  //     white-space: nowrap;
  //     vertical-align: middle;
  //     text-overflow: ellipsis;
  //   }
  //   i {
  //     font-size: 13px;
  //     color: rgba(0, 0, 0, 0.65);
  //     margin-left: 8px;
  //   }
  // }
  // .query-header-list {
  //   position: absolute;
  //   top: 30px;
  //   left: 0;
  //   width: 480px;
  //   max-height: 520px;
  //   overflow-y: auto;
  //   background: #fff;
  //   box-shadow: 0px 2px 8px 0px rgba(30, 85, 255, 0.15);
  //   border-radius: 4px;
  //   z-index: 30;
  //   .list-item {
  //     height: 32px;
  //     line-height: 32px;
  //     padding: 0 16px;
  //     cursor: pointer;
  //     position: relative;
  //     z-index: 9;
  //     &:hover {
  //       background: #f0f7ff;
  //     }
  //     &.selected {
  //       background: #f8fbff;
  //     }
  //     i {
  //       color: #1890ff;
  //       font-size: 18px;
  //       float: left;
  //     }
  //     .item-name {
  //       font-size: 14px;
  //       width: 292px;
  //       overflow: hidden;
  //       white-space: nowrap;
  //       text-overflow: ellipsis;
  //       margin-left: 8px;
  //       float: left;
  //     }
  //     .checked {
  //       float: right;
  //     }
  //   }
  // }
  .sheet {
    .sheet__body > .sheet__row {
      position: relative;
      &.marked::after {
        content: "";
        display: block;
        width: 4px;
        height: calc(100% - 1px);
        position: absolute;
        left: 0;
        top: 0;
        background: #faad14;
      }
    }
  }
  /*ie11 css hack*/
  @media all and (-ms-high-contrast: none) {
    .sheet {
      .sheet__row.sheet__head {
        padding-right: 17px;
      }
    }
  }
}
</style>
<style lang='less' scoped>
@import "./style/index.less";
@import './../../../../application/src/components/pc/style/custom-themes';
@media screen and (max-width: 1366px) {
  .application-box .table-box .no-data {
    margin-top: 50px;
  }
}
.modal-footer {
  height: 53px;
  line-height: 53px;
  text-align: right;
  margin-bottom: -24px;
  & button + button {
    margin-left: 8px;
    margin-bottom: 0;
  }
}
.actions-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-right: 16px;
  .settings {
    display: flex;
    align-items: center;
    .settings-item {
      margin-right: 16px;
      cursor: pointer;
      .form-track {
        font-size: 16px;
        transform: rotateY(180deg);
        rgba(0, 0, 0, 0.65)
        &:hover {
          color: @primary-color;
        }
      }

      .icon:hover {
        color: @primary-color;
      }
      .high-light {
        color: @primary-color;
      }
    }
  }
  #list-actions {
    display: flex;
    align-items: center;
    button {
    //   min-width: 80px;
    //   height: 32px;
    //   border-radius: 2px;
      margin-left: 8px;
      // padding: 0 16px;
    //   color: #111218;
    //   &.ant-btn-primary{
    //     color: #fff;
    //   }
    //   // &:last-of-type {
    //   //   margin-right: 0;
    //   // }
    }
  }
}

.table-box {
  position: relative;
  min-height: 400px;
  .import-icon{
    position: absolute;
    bottom: 103px;
    right: 48px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0px 2px 8px 0px rgba(168, 175, 186, 0.5);
    cursor: pointer;
    >img{
       width: 100%;
    }
  }
  .filters-box {
    position: absolute;
    width: 360px;
    right: 16px;
    z-index: 666;
    margin-top: -8px;
  }
  .table {
    display: flex;
    .custom-template-container{
      border-left: 1px solid #e8e8e8;
      border-right: 1px solid #e8e8e8;
     /*  width: 100%-250px !important; */
      width: 100%;
    }
    /deep/.sheet__body::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0);
      box-shadow: unset;
      transition: all ease 0.3s;
    }
    & /deep/.scrollbar .sheet__cols {
      opacity: 0;
    }

    &.active {
      /deep/.sheet__body::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.45);
        box-shadow: auto;
      }
      & /deep/.scrollbar .sheet__cols {
        opacity: 1;
      }
    }

    /deep/.sheet .sheet__body .sheet__row {
      transition: all ease 0.3s;
      &:hover {
        background: #f0f7ff;
      }
    }

    .common-table.active .common-table__tbody-wrap::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.45);
      box-shadow: auto;
    }
    height: 100%;
    max-height: calc(100% - 50px);
    width: 100%;
    background-color: #fff;
    // position: relative;
    // overflow-y: hidden;
    /deep/.ant-table-wrapper {
      height: 100%;
    }
    /deep/.ant-table-body {
      max-height: calc(100vh - 95px - 52px - 160px) !important;
    }
    &.has-filterbox {
      /deep/.ant-table-body {
        max-height: calc(100vh - 155px - 52px - 160px) !important;
      }
    }

    .order-number-box {
      .index {
        margin-left: @base4-padding-lg;
      }
    }
    .name {
      cursor: pointer;
    }
    .cursor {
      cursor: pointer;
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      &:hover {
        color: @primary-color;
      }
    }
    .no-columns {
      text-align: center;
      position: absolute;
      top: 40%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
  }
  /*ie11 css hack*/
  @media all and (-ms-high-contrast: none) {
    *::-ms-backdrop,
    .table {
      max-height: calc(100% - 68px);
    }
  }
}

.load-fail-box {
  padding-top: 100px;
  text-align: center;
}

/deep/.ant-pagination-total-text {
  margin-right: @base4-padding-md;
}
.pagination-box {
  margin-top: 0 !important;
  background-color: #fff;
  height: 49px;
  >span{
    height: 32px;
    line-height: 32px;
    color: rgba(0, 0, 0, 0.65);
    font-size: 14px;
  }
  /deep/.ant-pagination-options{
    margin-left: 8px;
  }
  /deep/.ant-pagination > li {
    border-radius: 2px;
    a,
    div,
    input{
      border-radius: 2px;
    }
    .ant-select-arrow{
      right: 7px;
    }
  }
}
/deep/.ant-pagination-options {
  height: 32px;
}
.delete-title {
  color: rgba(0, 0, 0, 0.85);
  font-weight: 600;
  i {
    height: 24px;
    content: "\E9A9";
    color: #FAAD14;
    font-weight: 100;
    font-size: 20px;
    width: 24px;
    padding-left: 1px;
    padding-top: 1px;
    padding-right: 15px;
  }
}
.delete-content {
  // background: #fffbe6;
  // border: 1px solid #ffe58f;
  // padding: 12px;
  // border-radius: 4px;
  // margin-top: 12px;
  margin-top: -8px;
  .delete-content-box {
    font-size: 12px;
    line-height: 22px;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 16px;
    a {
      margin-top: 5px;
    }
    &-li {
      width: 100%;
      height: 70px;
      padding: 0 20px 0 16px;
      display: flex;
      align-items: center;
      border-radius: 2px;
      border: 1px solid #e8eaed;
      color: #111218;
      font-size: 14px;
      font-weight: 700;
      display: flex;
      justify-content: space-between;
      margin-bottom: 8px;
      .delete-text-right {
        font-weight: 400;
        display: flex;
        align-items: center;
        > span {
          font-size: 18px;
          color: @primaryColor;
          margin: 0 5px;
        }
      }
      p {
        margin: 4px 0 0;
        font-size: 12px;
        font-size: 400;
        color: rgba(17, 18, 24, 0.5);
      }
    }
    i {
      font-size: 14px;
      color: #faad14;
      margin-right: 8px;
    }
  }
  .hidden {
    display: none;
  }
}
.filter-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0);
  z-index: 1;
}
.prints-drop-down {
  width: 150px;
  min-height: 40px;
  max-height: 350px;
  overflow-y: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px 0 rgba(30, 85, 255, 0.15);
  background: #fff;
  position: absolute;
  top: 35px;
  z-index: 999;
  .item-print {
    text-align: left;
    height: 32px;
    line-height: 32px;
    padding: 0px 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    &:hover {
      cursor: pointer;
      background: rgba(240, 247, 255, 1);
      transition: 0.3s all;
    }
    &:last-of-type {
      margin-bottom: 10px;
    }
    &:first-of-type {
      margin-top: 5px;
    }
  }
}
.list-action-FORM_TRACK,.list-action-form_track {
  margin-left: 8px;
}

.iframe-form-warp {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    // left: 50%;
    // transform: translateX(-50%);
    margin: auto;
    min-width: 1024px;
    max-width: 1228px;
    background: #fff;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    &--page {
      width: 100%;
      height: 100%;
      overflow: auto;
      border: none;
    }
  }
  .iframe-shadow{
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 999;
  }

  .fade-down-enter-active {
    transition: all .3s ease;
  }
  .fade-down-leave-active {
    transition: all 0s cubic-bezier(1.0, 0.5, 0.8, 1.0);
  }
  .fade-down-enter, .fade-down-leave-to
  /* .slide-fade-leave-active 用于 2.1.8 以下版本 */ {
    transform: translateY(-30px);
    opacity: 0;
  }

  .icon-close{
    position: absolute;
    right: 24px;
    cursor: pointer;
    top: 12px;
    font-size: 20px;
    color: rgba(17, 18, 24, 0.5);
    vertical-align: baseline;
  }

  .icon-close:hover{
    cursor: pointer;
    color: @highlightColor
  }
</style>



<style lang="less" scoped>
@import './../../../../application/src/components/pc/style/custom-themes';
/**
  新版表单样式
*/
/deep/ .custom-template-container .table-container .table-row {
  min-height: 36px;
  &.table-head-row {
    .table-row-item {
      background-color: #f8f8fb;
      color: #111218;
      font-size: 13px;
      font-weight: 700;

      &.fixed-left-column-last {
        border-right: 1px solid #e8eaed;
      }
    }
  }
}

/deep/ .custom-template-container .table-container .table-body-row {
  .table-row-item {
    border-right: 1px solid #e8eaed;
  }
}


/deep/
  .custom-template-container
  .table-head-wrapper
  .table-row
  .table-row-item
  .resize-bar {
  top: 0;
  height: 100%;
  border-right: 1px solid #e8eaed;
}

/deep/ .custom-template-container .table-head-wrapper .table-head-value {
  justify-content: space-between;
}

/deep/ .head-value-up_down .icon-up_down,
/deep/ .head-value-up_down .icon-up_down {
  color: rgba(17, 18, 24, 0.25) !important;
  font-size: 12px;
  position: relative;
  &:hover {
    color: @primaryColor !important;
  }
  &.anticon-caret-up {
    top: 2px;
  }
  &.anticon-caret-down {
    top: -2px;
  }
}

/deep/
  .custom-template-container
  .table-body-row
  .table-row-item
  .col-inner-wrapper {
  color: #111218;
  font-size: 13px;
  height: 36px;
  display: flex;
  align-items: center;
}
/deep/ .ant-breadcrumb {
  > span {
    font-size: 12px;
    font-weight: 400;
    color: rgba(17, 18, 24, 0.5);
  }
  > span:last-child {
    font-weight: 700;
    color: #111218;
  }
}

.list-actions-more {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  line-height: 32px;
  text-align: center;
  // margin-right: 8px;
  cursor: pointer;
  &:hover {
    background: rgba(0, 30, 116, 0.06);
    i{
      color: @primaryColor;
    }
  }
  i {
    color: rgba(17, 18, 24, 0.5);
    font-size: 22px;
    position: relative;
    top: 2px;
  }
 
}

.table-toolbar {
  margin: 0 16px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  .table-toolbar-box {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    // box-shadow: 0px 1px 0px 0px #eeeeee;
    height: 46px;
    border: 1px solid #e8e8e8;
    border-bottom: none;
    &-li {
      margin-right: 16px;
      font-size: 12px;
      font-weight: 400;
      color: rgba(17, 18, 24, 0.5);
      cursor: pointer;
      white-space: nowrap;
      >span{
        white-space: nowrap;
        >span{
          vertical-align: 1px;
        }
      }
      i {
        font-size: 14px;
        color: rgba(17, 18, 24, 0.25);
        // margin-right: 4px;
      }
      &:hover {
        color: @primaryColor;
        i {
          color: @primaryColor;
        }
      }
      &.high-light {
        color: @primaryColor;
        >i{
          color: @primaryColor;
        }
      }
    }
  }
}

</style>

<style lang="less">
@import './../../../../application/src/components/pc/style/custom-themes';
.list-actions-popover {
  .ant-popover-inner-content {
    padding: 4px 0 !important;
    word-break: keep-all;
    > p {
      min-width: 124px;
      height: 36px;
      padding: 0 20px;
      line-height: 36px;
      cursor: pointer;
      margin: 0;
      &:hover {
        background-color: @hoveBGColor;
        color: @primaryColor;
      }
    }
  }
}

.font-setting-drag{
  .ant-popover-inner-content{
    padding: 0;
    padding-bottom: 16px;
  }
}
</style>
<style lang="less" scoped>
@import './../../../../application/src/components/pc/style/custom-themes';
/deep/.ant-btn {
  min-width: 80px;
  height: 32px;
  border-radius: 2px;
  padding: 0 12px;
  &.ant-btn-default {
    background: #FFFFFF;
    border: 1px solid #D4D5D6;
    >span{
      height: 22px;
      font-size: 14px;
      color: #111218;
      line-height: 22px;
    }
    &:hover {
      border: 1px solid @primaryColor;
      >span{
        color: @primaryColor;
      }
    }
    &:active {
      border: 1px solid @primaryColor;
      >span{
        color: @primaryColor;
      }
    }
  }
  &.ant-btn-primary {
    // background: @primaryColor;
    >span{
      height: 22px;
      font-size: 14px;
      color: rgba(255, 255, 255, 0.9);
      line-height: 22px;
    }
  }
  &:disabled {
    background: #F1F2F6 !important;
    border: 1px solid #D4D5D6 !important;
    >span{
      height: 22px;
      font-size: 14px;
      color: rgba(17, 18, 24, 0.25) !important;
      line-height: 22px;
    }
  }
}
.tree-total{
  height: 32px;
  line-height: 32px;
}
</style>
